package com.echo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 考试的详细信息表
 * </p>
 *
 * @author echo
 * @since 2024-10-31
 */
@Data
@TableName("exam")
public class Exam implements Serializable {

    private static final long serialVersionUID = 1L;
    //关联的课程id，专为某个课程而创建的试卷
    private Integer courseId;
    /**
     * 考试表的主键
     */
    @TableId(value = "exam_id", type = IdType.AUTO)
    private String examId;

    /**
     * 考试名称
     */
    private String examName;

    /**
     * 考试的预览图
     */
    private String examAvatar;
    private String examType;
    /**
     * 考试描述
     */
    private String examDescription;

    /**
     * 当前考试下的题目的id用-连在一起地字符串
     */
    private String examQuestionIds;

    /**
     * 当前考试下的题目单选题的id用-连在一起地字符串
     */
    private String examQuestionIdsRadio;

    /**
     * 当前考试下的题目多选题的id用-连在一起地字符串
     */
    private String examQuestionIdsCheck;

    /**
     * 当前考试下的题目判断题的id用-连在一起地字符串
     */
    private String examQuestionIdsJudge;

    /**
     * 当前考试的总分数
     */
    private Integer examScore;

    /**
     * 当前考试每个单选题的分数
     */
    private Integer examScoreRadio;

    /**
     * 当前考试每个多选题的分数
     */
    private Integer examScoreCheck;
    //是不是ai生成的
    //默认是false，即不是ai生成的
    private Boolean examIfAi;
    /**
     * 当前考试每个判断题的分数
     */
    private Integer examScoreJudge;
    private Integer examTimeLimit;
    /**
     * 考试创建者的用户id
     */
    private String examCreatorId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date examStartDate;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date examEndDate;
    /**
     * 创建时间, 设计表时设置了自动插入当前时间，无需在Java代码中设置了
     */

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新时间，设计表时设置了自动插入当前时间，无需在Java代码中设置了。
     * 同时@DynamicUpdate注解可以时间当数据库数据变化时自动更新，无需人工维护
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @Override
    public String toString() {
        return "Exam{" +
            "examId=" + examId +
            ", examName=" + examName +
            ", examAvatar=" + examAvatar +
            ", examDescription=" + examDescription +
            ", examQuestionIds=" + examQuestionIds +
            ", examQuestionIdsRadio=" + examQuestionIdsRadio +
            ", examQuestionIdsCheck=" + examQuestionIdsCheck +
            ", examQuestionIdsJudge=" + examQuestionIdsJudge +
            ", examScore=" + examScore +
            ", examScoreRadio=" + examScoreRadio +
            ", examScoreCheck=" + examScoreCheck +
            ", examScoreJudge=" + examScoreJudge +
            ", examCreatorId=" + examCreatorId +
            ", examTimeLimit=" + examTimeLimit +
            ", examStartDate=" + examStartDate +
            ", examEndDate=" + examEndDate +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
        "}";
    }
}
